Imports System.ComponentModel
Imports System.Web.UI

<ToolboxData("<{0}:Chapter3Custom runat=server></{0}:Chapter3Custom>")> Public Class Chapter3Custom
    Inherits System.Web.UI.WebControls.WebControl
    Protected Overrides Sub CreateChildControls()
        Dim lbl As New System.Web.UI.WebControls.Label
        Dim pnl As New System.Web.UI.WebControls.Panel
        Dim btn As New System.Web.UI.WebControls.Button
        Dim txt As New System.Web.UI.WebControls.TextBox

        pnl.BorderStyle = WebControls.BorderStyle.Solid
        pnl.BorderWidth = 1
        pnl.Wrap = True

        lbl.BorderStyle = WebControls.BorderStyle.Solid
        lbl.BorderWidth = 1
        lbl.Text = "In a Custom Control"
        pnl.Controls.Add(lbl)

        txt.Text = "In a Custom Control"
        pnl.Controls.Add(txt)

        btn.Text = "In a Custom Control"
        pnl.Controls.Add(btn)

        Me.Controls.Add(pnl)
    End Sub
End Class
